﻿@using KPIS.GERP.SERVICE.Model
@model hrm_ps_command_dtls

@using (Html.BeginForm("EditDetail", "CommandPenalty", FormMethod.Post))
{
    @* @Html.AntiForgeryToken() *@
    @Html.ValidationSummary(true)
    <h3 class="header">แก้ไขรายชื่อในคำสั่ง</h3>
    <div class="detail">
        <h3><label id="lblCmdTypeName"></label></h3>
        @Html.HiddenFor(model => model.cmd_seq)
        @Html.HiddenFor(model => model.cmd_dtls_seq)

        <table class="info">
            <tr class="left2">
                <td class="editor-label">
                    @Html.LabelFor(model => model.emp_seq)
                </td>
                <td class="editor-field">
                    @(Html.Telerik().ComboBoxFor(m => m.emp_seq)
                        .BindTo(new SelectList(new GERPContext().hrm_ps_employees
                            .OrderBy(m => m.first_name)
                            .OrderBy(m => m.last_name)
                            .Where(m => m.record_status != "D" && m.hrm_ps_employee_statuses.active == "1")
                            .ToList(), "emp_seq", "full_name"))
                        //.SelectedIndex(Model != null ? (Model.hrm_ps_command_dtls.emp_seq != null ? Model.hrm_ps_command_dtls.emp_seq.Value : -1) : -1)
                        .HighlightFirstMatch(true)
                        .Filterable(filtering => filtering.FilterMode(AutoCompleteFilterMode.Contains))
                    )
                    @Html.ValidationMessageFor(model => model.emp_seq)
                </td>
            </tr>
            <tr class="left">
                <td class="editor-label">
                    @Html.LabelFor(model => model.start_date)
                </td>
                <td class="editor-field">
                    @Html.EditorFor(model => model.start_date)
                    @Html.ValidationMessageFor(model => model.start_date)
                </td>
            </tr>
            <tr class="left2">
                <td class="editor-label">
                    @Html.LabelFor(model => model.end_date)
                </td>
                <td class="editor-field">
                    @Html.EditorFor(model => model.end_date)
                    @Html.ValidationMessageFor(model => model.end_date)
                </td>
            </tr>
            <tr class="left">
                <td class="editor-label">
                    @Html.LabelFor(model => model.remarks)
                </td>
                <td class="editor-field">
                    @Html.EditorFor(model => model.remarks)
                    @Html.ValidationMessageFor(model => model.remarks)
                </td>
            </tr>
            <tr class="left2">
                <td class="editor-label">
                    @Html.LabelFor(model => model.rpt_remarks)
                </td>
                <td class="editor-field">
                    @Html.EditorFor(model => model.rpt_remarks)
                    @Html.ValidationMessageFor(model => model.rpt_remarks)
                </td>
            </tr>
        </table>
    
    <p id="pnlCommand2">
        <input type="submit" value="บันทึก" />&nbsp;&nbsp;<a id="lnkEditCancel" title="คลิกเพื่อยกเลิกการแก้ไข" >ยกเลิก</a>
    </p>
    </div>
}